using AZROLESLib;
using AzManContrib.MVC.Decorators;

namespace AzManContrib.MVC.Initialization
{
    public class Synchronously : IAzManInitializationType
    {
        public void Init(InitializationContext initializationContext)
        {
            AzMan.AzManStore = new AzManAuthorizationStoreDecorator(new AzAuthorizationStoreClass());
            AzMan.Store.Initialize(0, initializationContext.ConnectionString, null);

            AzMan.AzManApplication = AzMan.Store.OpenApplication(initializationContext.ApplicationName);
            AzMan.Initialized = true;
        }
    }
}